
# This algorithm is not very complex.  The chosen percentage of time to hunt is 31.5%
# There will be a lot of slacking by me.  The groups I chose to slack with are the 58.5%
# with the worst reputation, to do my part to make sure their slacking does not pay off,
# and also, because  they may be looking for less partners because they slack more.
# I also am slacking with the top 10% of reputations, because they will likely be
# looking for more hunting partners, and they may have more forgiving criteria to
# choose hunting partners.  Also, if there are less than 30 players remaining,
# the game is likely close to an end, so I will slack every hunt at that point.


def hunt_choices(round_number, current_food, current_reputation, m,  player_reputations):

    # slack with players over this percent
    TOP_SLACK = 0.90
    # slack with players below this percent
    BOTTOM_SLACK = 0.585

    players = len(player_reputations)

    # slack every time if less than 30 players
    if players < 30:
        hunt_decisions = ['s' for x in player_reputations]
        return hunt_decisions

    hunt_decisions = list()

    # sort the player reputation list
    sorted_list = sorted(player_reputations)

    # position that is considered high enough to slack
    top_cut_off_pos = int(TOP_SLACK * players)
    # position that is considered low enough to slack
    bottom_cut_off_pos = int(BOTTOM_SLACK * players)

    # reputation that is considered high enough to slack
    top_cut_off_rep = sorted_list[top_cut_off_pos]
    # reputation that is considered low enough to slack
    bottom_cut_off_rep = sorted_list[bottom_cut_off_pos]

    for rep in player_reputations:
        # if a player's reputation is below the top cut off and above the
        # bottom cut off, hunt
        if rep < top_cut_off_rep and rep > bottom_cut_off_rep:
            hunt_decisions.append('h')
        # else slack
        else:
            hunt_decisions.append('s')

    return hunt_decisions


def hunt_outcomes(food_earnings):
    pass


def round_end(award, m, number_hunters):
    pass
